import Vue from "vue";
import Router from "vue-router";
// import HelloWorld from '@/components/HelloWorld'
import login from "@/views/login.vue";

// 管理后台中心路由
import center from "@/views/layout/center.vue";
import userManager from "@/views/layout/userManager.vue";
import orderCheck from "@/views/layout/orderCheck.vue";
import managerCenter from "@/views/layout/managerCenter.vue";
import manageMent from "@/views/layout/manageMent.vue";

// 新窗口新闻资讯
import newsInformation from "@/components/newsInformation/newsInformation.vue";

// 员工管理后台路由
import userCenter from "@/views/layout/userCenter.vue";
import user from "@/views/layout/user.vue";

// 测试
import test from "@/views/test.vue";
// import { name } from "file-loader";
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "login",
      component: login
    },
    {
      path: "/newsInformation",
      name: "newsInformation",
      component: newsInformation
    },
    {
      path: "/center",
      name: "center",
      component: center, //这里是核心： center作为容器组件，包含左右菜单和右侧的router-view，所以下面的子组件实际是显示在router-view
      redirect: "/center/userManager", //输入路由center会重定向到a页面
      children: [
        {
          path: "/",
          name: "userManager",
          component: userManager,
          meta: {
            title: "页面a"
          }
        },
        {
          path: "orderCheck",
          name: "orderCheck",
          component: orderCheck,
          meta: {
            title: "页面b"
          }
        },
        {
          path: "managerCenter",
          name: "managerCenter",
          component: managerCenter,
          meta: {
            title: "页面c"
          }
        },
        {
          path: "manageMent",
          name: "manageMent",
          component: manageMent
        }
      ]
    },
    {
      path: "/userCenter",
      name: "userCenter",
      component: userCenter, //这里是核心： center作为容器组件，包含左右菜单和右侧的router-view，所以下面的子组件实际是显示在router-view
      redirect: "/userCenter/user", //输入路由center会重定向到a页面
      children: [
        {
          path: "/",
          name: "user",
          component: user,
          meta: {
            title: "员工"
          }
        }
      ]
    },
    {
      path: "/test",
      name: "test",
      component: test
    }
    // {
    //   path: '/newsCenter',
    //   name: 'newsCenter',
    //   component: newsCenter,
    //   redirect:{name:'orderCheck'},
    //   childern: [
    //     {
    //     path: 'orderCheck',
    //     name: 'orderCheck',
    //     component: orderCheck
    //   },
    //     {
    //     path: '/managerPerson',
    //     name: 'managerPerson',
    //     component: managerPerson
    //   }
    // ]
    // }
  ]
});
